package com.ctp.ui.table;

import com.ctp.thread.factory.ThreadFactory;
import com.ctp.ui.table.util.TableColumnBean;
import com.ctp.ui.table.util.TableRendererLib;

public class MarketTable extends AbstractTableUI {

	private static final long serialVersionUID = 1L;

	public MarketTable() {
		this.setSize(756, 69);
	}

	protected void initTableData() {
		for (String currMarket : MARKET_LIST) {
			String[] marketData = new String[COLUMN_LIST.length];
			marketData[0] = currMarket;

			tableModel.addRow(marketData);
		}

		ThreadFactory.startMarketThread(tableModel);
	}

	protected TableColumnBean[] getTableColumn() {
		return COLUMN_LIST;
	}

	private static final String[] MARKET_LIST = { "ag1209", "ag1212", "价差" };

	private static final TableColumnBean[] COLUMN_LIST = {
			new TableColumnBean("合约名", TableRendererLib.STRING_RENDERER),
			new TableColumnBean("最新价", TableRendererLib.INT_RENDERER),
			new TableColumnBean("买一价", TableRendererLib.INT_RENDERER),
			new TableColumnBean("买一量", TableRendererLib.INT_RENDERER),
			new TableColumnBean("卖一价", TableRendererLib.INT_RENDERER),
			new TableColumnBean("卖一量", TableRendererLib.INT_RENDERER),
			new TableColumnBean("成交量", TableRendererLib.INT_RENDERER),
			new TableColumnBean("持仓量", TableRendererLib.INT_RENDERER) };

}
